import request from "@/utils/request";

// 查询租赁表列表
export function listRent(query) {
  return request({
    url: "/rent/list",
    method: "get",
    params: query,
  });
}

// 查询自行车树
export function rentTree() {
  return request({
    url: "/rent/rentTree",
    method: "get",
  });
}

// 统计
export function statistics() {
  return request({
    url: "/rent/statistics",
    method: "get",
  });
}

// 查询租赁表详情
export function getRent(rentId) {
  return request({
    url: "/rent/" + rentId,
    method: "get",
  });
}

// 新增租赁表
export function addRent(data) {
  return request({
    url: "/rent",
    method: "post",
    data: data,
  });
}

// 修改租赁表
export function updateRent(data) {
  return request({
    url: "/rent",
    method: "put",
    data: data,
  });
}

// 归还单车
export function returnBike(data) {
  return request({
    url: "/rent/returnBike",
    method: "put",
    data: data,
  });
}

// 删除租赁表
export function deleteRent(rentId) {
  return request({
    url: "/rent/" + rentId,
    method: "delete",
  });
}
